package cn.iocoder.yudao.module.erp.dal.mysql.purchaseinorder;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchaseinorder.PurchaseInOrderDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.purchaseinorder.vo.*;

/**
 * ERP采购入库审批单 Mapper
 *
 * @author TQY
 */
@Mapper
public interface PurchaseInOrderMapper extends BaseMapperX<PurchaseInOrderDO> {

    default PageResult<PurchaseInOrderDO> selectPage(PurchaseInOrderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PurchaseInOrderDO>()
                .eqIfPresent(PurchaseInOrderDO::getOutOrderId, reqVO.getOutOrderId())
                .eqIfPresent(PurchaseInOrderDO::getIntegrateId, reqVO.getIntegrateId())
                .eqIfPresent(PurchaseInOrderDO::getPurchaseOrderId, reqVO.getPurchaseOrderId())
                .eqIfPresent(PurchaseInOrderDO::getPriInId, reqVO.getPriInId())
                .eqIfPresent(PurchaseInOrderDO::getSupplierId, reqVO.getSupplierId())
                .eqIfPresent(PurchaseInOrderDO::getOpinion, reqVO.getOpinion())
                .eqIfPresent(PurchaseInOrderDO::getStatus, reqVO.getStatus())
                .eqIfPresent(PurchaseInOrderDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .betweenIfPresent(PurchaseInOrderDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PurchaseInOrderDO::getCreateTime));
    }

}